package cn.yuanqiao.es.service;

import cn.yuanqiao.es.domain.ElasticsearchQuery;
import cn.yuanqiao.es.domain.QueryFile;
import co.elastic.clients.elasticsearch.core.SearchResponse;

/**
 * Elasticsearch基础功能组件
 *
 * @ProjectName: ruoyi-modules-system
 * @Package: cn.yuanqiao.es.service
 * @ClassName: ElasticsearchTemplate
 * @Author: lenovo
 * @Description: hbWang
 * @Date: 2023/6/13 16:11
 * @Version: 1.0
 */
public interface ElasticsearchTemplate {
    /**
     * 支持分页、高亮、排序的查询
     *
     * @param
     * @return
     * @throws Exception
     */
    SearchResponse<Object> search(QueryFile query, String indexName);

    /**
     * 查询联想词
     *
     * @param key
     * @param indexName
     * @return
     */
    SearchResponse<Object> searchAssociate(String key, String indexName);

    /**
     * 判断电子文件哪些匹配
     *
     * @param query
     * @return
     */
    String queryMultiMatch(ElasticsearchQuery query);

    /**
     * 小程序查询
     *
     * @param query
     * @param indexName
     * @return
     */
    public SearchResponse<Object> searchApp(QueryFile query, String indexName);


}
